package com.example.demo.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 借阅
 */
public class Lend {

    private int ser_num;
    private int book_id;
    private int reader_id;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date lend_date;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date back_date;
    private BigDecimal finenum;
    private int is_return;//1-归还,0-未归还
    private int fine; //罚款 1-已交,0-未交 2-未欠款

    private User user;

    private Books books;

    public Lend() {
    }

    public Lend(int book_id, int reader_id, Date lend_date, Date back_date, BigDecimal finenum, int is_return, int fine) {
        this.book_id = book_id;
        this.reader_id = reader_id;
        this.lend_date = lend_date;
        this.back_date = back_date;
        this.finenum = finenum;
        this.is_return = is_return;
        this.fine = fine;
    }

    @Override
    public String toString() {
        return "Lend{" +
                "ser_num=" + ser_num +
                ", book_id=" + book_id +
                ", reader_id=" + reader_id +
                ", lend_date=" + lend_date +
                ", back_date=" + back_date +
                ", finenum=" + finenum +
                ", is_return=" + is_return +
                ", fine=" + fine +
                ", user=" + user +
                ", books=" + books +
                '}';
    }

    public int getSer_num() {
        return ser_num;
    }

    public void setSer_num(int ser_num) {
        this.ser_num = ser_num;
    }

    public int getBook_id() {
        return book_id;
    }

    public void setBook_id(int book_id) {
        this.book_id = book_id;
    }

    public int getReader_id() {
        return reader_id;
    }

    public void setReader_id(int reader_id) {
        this.reader_id = reader_id;
    }

    public Date getLend_date() {
        return lend_date;
    }

    public void setLend_date(Date lend_date) {
        this.lend_date = lend_date;
    }

    public Date getBack_date() {
        return back_date;
    }

    public void setBack_date(Date back_date) {
        this.back_date = back_date;
    }

    public BigDecimal getFinenum() {
        return finenum;
    }

    public void setFinenum(BigDecimal finenum) {
        this.finenum = finenum;
    }

    public int getIs_return() {
        return is_return;
    }

    public void setIs_return(int is_return) {
        this.is_return = is_return;
    }

    public int getFine() {
        return fine;
    }

    public void setFine(int fine) {
        this.fine = fine;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Books getBooks() {
        return books;
    }

    public void setBooks(Books books) {
        this.books = books;
    }
}
